package com.itheima.movies.controller;

import com.itheima.movies.domain.Movies;
import com.itheima.movies.service.MoviesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/movies")
public class MoviesController {
    @Autowired
    private MoviesService moviesService;

    @RequestMapping(value = "/findAll",name = "查询所有")
    @ResponseBody//json格式
    public List<Movies> findAll(){
        List<Movies> moviesList = moviesService.findAll();
        return moviesList;
    }
}
